import { defineStore } from 'pinia'


export const totalTheme = defineStore('totalTheme', {
  persist: true,
  state: () => {
    return {
      state: false,
      background: '#fff',
      text_color:"#000"
    }
  },
  actions: {
    changeTheme(theme: string) {
      if (theme === 'light') {
        this.state = false
        this.background = '#fff'
        this.text_color = "#000"
      } else {
        this.state = true
        this.background = '#545c64'
        this.text_color = "#fff"
      }
      document.body.style.backgroundColor = this.background
    }
  }
})